package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Type generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "type", catalog = "book")
public class TypeEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer typeId;
	private String typeName;
	private Set<StationeryEntity> stationeries = new HashSet<StationeryEntity>(0);

	public TypeEntity() {
	}

	public TypeEntity(String typeName) {
		this.typeName = typeName;
	}

	public TypeEntity(String typeName, Set<StationeryEntity> stationeries) {
		this.typeName = typeName;
		this.stationeries = stationeries;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "type_id", unique = true, nullable = false)
	public Integer getTypeId() {
		return this.typeId;
	}

	public void setTypeId(Integer typeId) {
		this.typeId = typeId;
	}

	@Column(name = "type_name", nullable = false, length = 50)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "type")
	public Set<StationeryEntity> getStationeries() {
		return this.stationeries;
	}

	public void setStationeries(Set<StationeryEntity> stationeries) {
		this.stationeries = stationeries;
	}

}
